package IC.Types;

public class ArrayType extends Type {
    
	private Type arrayType;
	private boolean refVal = true;

    public ArrayType(Type type) 
    {
        super(String.format("%s[]",type.getTypeName()));
        arrayType = type;
    }

    public Type getArrayType() {
        return arrayType;
    }

    public boolean isRef() {
        return refVal;
    }
    
    public boolean isSub(Type ty) {
        return (ty == this);
    }

    public String toString() {
        return String.format("%d: Array type: %s", getTypeId(), getTypeName());
    }
}
